<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>图书馆购物车2 </title>
    <link rel="stylesheet" href="../table.css">
</head>

<body>
    <div id="app">
        <div v-if="books.length">
            <table>
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>数据名称</th>
                        <th>出版日期</th>
                        <th>价格</th>
                        <th>购买数量</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(item,index) in books">
                        <td>{{item.id}}</td>
                        <td>{{item.name}}</td>
                        <td>{{item.time}}</td>
                        <td>{{item.price|test(item.price)}}</td>
                        <td>
                            <button @click="decremoe(index)" v-bind:disabled="item.count<=1">-</button> {{item.count}}
                            <button @click="incremoe(index)">+</button>
                        </td>
                        <td>
                            <button style="width:40px" @click="delitem(index)">删除</button>
                        </td>
                    </tr>
                </tbody>
            </table>
            <h2>总计:{{totalmoney|test()}}</h2>
        </div>
        <div v-else style="margin:200px 400px">快去加入购物车</div>
    </div>
    <script src="../vue.min.js"></script>
    <script src="./js/shapping.js"></script>
</body>

</html>